﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GrayParrot.Extensions.Strings
{
    public static partial class StringExtensions
    {
        /// <summary>
        /// Substrings from end.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="startindex">The startindex.</param>
        /// <returns></returns>
        public static string SubstringFromEnd(this string value, int startindex)
        {
            if (string.IsNullOrEmpty(value)) return value;
            return value.Substring(0, value.Length - startindex);
        }
    }
}
